<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="en" class="no-js" id="ng-app">
<head>
<meta charset="UTF-8">
<jsp:include page="/includes/common/head.jsp" />
<title>CS4280 BOOKSTORE</title>
</head>
<body>
	<div data-flex-background-src="${ baseURL }/assets/img/background.jpg"
		flex-background></div>
	<jsp:include page="/includes/header.jsp">
		<jsp:param name="currentUser" value="${currentUser}" /><jsp:param name="baseURL" value="${ baseURL }" />
	</jsp:include>
	<section id="mainContent">
	<c:if test="${action!=null && action=='most_viewed' }">
		Most Viewed Books 
	</c:if>
	
	<c:if test="${action!=null && action=='most_purchased' }">
		Most Purchased Books
	</c:if>
	<section id="content">
	<table class="shush-table">
		<tr class="table_header">
			<td>BOOK ID</td>
			<td>BOOK NAME</td>
			
			<c:if test="${action!=null && action=='most_viewed' }">
				<td>VIEWED</td>
			</c:if>	
			<c:if test="${action!=null && action=='most_purchased' }">
				<td>SALES</td>
			</c:if>
		</tr>
		<c:forEach var="book" items="${bookList}">
			<tr>
				<td>${book.id}</td>
				<td>${book.title}</td>
				
				<c:if test="${action!=null && action=='most_viewed' }">
					<td>${book.noOfView}</td>
				</c:if>	
				<c:if test="${action!=null && action=='most_purchased' }">
					<td>${book.noOfPurchase}</td>
				</c:if>
			</tr>
		</c:forEach>
	</table>
	</section>
	</section>
</body>
</html>
